package com.cn.web.controller.EM.tool;

import com.alibaba.fastjson2.JSONObject;
import com.cn.bean.vo.EM.partRegt.BarkPar;
import com.cn.mapper.dao.db5.EM.auto.SingleDao;
import com.cn.mapper.dao.db5.EM.tool.QrCodeGenerationDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@Transactional
@RequestMapping("/qrcode")
public class QrCodeGenerationController {
    private final QrCodeGenerationDao qrCodeGenerationDao;

    @Autowired(required = false)
    public QrCodeGenerationController(QrCodeGenerationDao qrCodeGenerationDao) {
        this.qrCodeGenerationDao = qrCodeGenerationDao;
    }
    @RequestMapping("/getQRrCode")
    @ResponseBody
    public String getQRrCode(@RequestBody JSONObject jsonObject) {
        System.out.println("二维码："+jsonObject);
        return qrCodeGenerationDao.getQRrCode(String.valueOf(jsonObject));
    }
    @RequestMapping("/iuQRrCode")
    @ResponseBody
    public BarkPar iuQRrCode(@RequestBody JSONObject jsonObject) {
        System.out.println("二维码："+jsonObject);
        return qrCodeGenerationDao.iuQRrCode(String.valueOf(jsonObject));
    }


}
